<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>登录界面</title>
    <script>
        function createCookie(username, password) {
            document.cookie = "username=" + username + "; password=" + password;
        }

        // 在表单提交前调用这个函数
        document.addEventListener('DOMContentLoaded', function () {
            document.getElementById('loginForm').addEventListener('submit', function (event) {
                event.preventDefault();
                var username = document.getElementById('username').value;
                var password = document.getElementById('password').value;
                createCookie(username, password);
                this.submit(); // 提交表单
            });
        });
    </script>
</head>

<body>
    <form action="http://106.54.0.164:9090/login/login/" method="post" id="loginForm">
        <label for="username">Username:</label><br>
        <input type="text" id="username" name="username"><br>
        <label for="password">Password:</label><br>
        <input type="password" id="password" name="password"><br>
        <input type="submit" value="Submit">
    </form>
</body>

</html>
